/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.p10.miage.gestionnote.model;

import fr.p10.miage.gestionnote.modelservice.EcsIntervenantServices;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author gernni
 */
public class EcsIntervenant {
    private int idItervenant;
    private List<EcIntervenant> listEcIntervenant;

    public EcsIntervenant(int idItervenant) {
        this.idItervenant=idItervenant;
        try {
            this.listEcIntervenant = EcsIntervenantServices.getEcsIntervenant(this.idItervenant);
        } catch (SQLException ex) {
            Logger.getLogger(EcsIntervenant.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public EcIntervenant getEcIntervenantById(int idEc,int idP)
    {
        EcIntervenant tmp = null;
        for (int i = 0; i < this.listEcIntervenant.size(); i++) {
		if(this.listEcIntervenant.get(i).getIdec()==idEc && this.listEcIntervenant.get(i).getIdP()==idP)
                {
                    tmp=this.listEcIntervenant.get(i);
                }
	}
        return tmp;
    }
    
    public List<EcIntervenant> getListEcs() {
        return listEcIntervenant;
    }

    public void setListEcIntervenant(List<EcIntervenant> listEcs) {
        this.listEcIntervenant = listEcs;
    }
}
